<?php defined('IN_IA') or exit('Access Denied');?><?php  include $this->template('common/header', TEMPLATE_INCLUDEPATH);?>
<ul class="nav nav-tabs">
	<li><a href="<?php  echo create_url('site/module/GetFans',array('name'=>'ifans','state'=>''));?>">同步微信用户</a></li>
    <li class="active"><a href="<?php  echo create_url('site/module/GetFans',array('name'=>'ifans','state'=>''));?>">微信用户列表</a></li>
    
</ul>
<div class="main">
	<div class="stat">
		<div class="stat-div">
			<div class="navbar navbar-static-top">

			</div>
			<div class="sub-item" id="table-list">
                <form action="" method="post" onsubmit="">
                    <div>
                        昵称：<input name="nickname" value="<?php  echo $nickname;?>" type="text"/> &nbsp;&nbsp;&nbsp;&nbsp;
                        真实姓名：<input name="realname" value="<?php  echo $realname;?>" type="text"/>&nbsp;&nbsp;&nbsp;&nbsp;
                        用户角色：<select name="type">
                            <option value="">请选择</option>
                            <option value="0" <?php  if($type==0 ) { ?> selected <?php  } ?>>普通关注者</option>
                            <option value="1" <?php  if($type==1 ) { ?> selected <?php  } ?>>厨师</option>
                            <option value="2" <?php  if($type==2 ) { ?> selected <?php  } ?>>名店</option>
                        </select>
                        &nbsp;&nbsp;&nbsp;&nbsp;<input name="sub" type="submit" value="提交" />
                    </div>
                </form>
				<h4 class="sub-title">详细数据(共<?php  echo $total;?>名关注者 )</h4>
				<form action="" method="post" onsubmit="">
				<div class="sub-content">
					<table class="table table-hover">
						<thead class="navbar-inner">
							<tr>
								<th class="row-first" width="50"><input type="checkbox" onclick="selectall(this, 'select');" /></th>
								<th  width="80">昵称</th>
								<th  width="100">用户角色</th>
    							<th  width="100">真实姓名</th>
                                <th  width="100">联系电话</th>
                                <th  width="150">店铺名称</th>
    							<th  width="120">关注时间</th>
								<th>操作</th>
							</tr>
						</thead>
						<tbody >
							<?php  if(is_array($list)) { foreach($list as $row) { ?>
                            
                            <?php 
                            
                            //$uinfo=pdo_getuserinfo($_W['weid'],"",$row["id"]);
                            
                            ?>
							<tr>
								<td class="row-first"><input type="checkbox" name="select[]" value="<?php  echo $row['id'];?>" /></td>
								<td style="text-align:center;">
                                <?php  if(strlen($row['avatar'])>10 ) { ?>
                                    <img src="<?php  echo $row['avatar'];?>" width="50" />
                                <?php  } else { ?>
                                    <img src="/manage/images/i07.png" width="50" />
                                <?php  } ?>
                                
                                <br />
                                <a href="<?php  echo create_url('site/module/profile', array('name' => 'fans','from_user' => $row['from_user']))?>" title="<?php  echo $row['nickname'];?>"><?php  echo $row['nickname'];?></a></td>

                                <td style="text-align:center;">
                                    <?php  if($uinfo['grade']==1 ) { ?>
                                        厨师
                                    <?php  } else if($uinfo['grade']==2 ) { ?>
                                        名店
                                    
                                    <?php  } else { ?>
                                       普通关注者
                                    <?php  } ?>
                                </td>
								<td style="text-align:center;">
									<?php  echo $row['realname'];?>
								</td>
								<td style="text-align:center;">
									<?php  echo $row['mobile'];?>
								</td>                                                                
								<td style="text-align:center;">
									<?php  echo $row['company'];?>
								</td>   
								<td style="font-size:12px;text-align:center;color:#666;">
									<?php  echo date('Y-m-d H:i:s', $row['createtime']);?>
								</td>
								<td style="text-align:center;">
									<a href="<?php  echo create_url('site/module/profile', array('name' => 'fans','from_user' => $row['from_user']))?>">编辑</a>
									<a href="<?php  echo create_url('site/module/send', array('name' => 'ifans', 'openid' => $row['from_user']))?>">联系TA</a>
                                                                        <a href="<?php  echo create_url('site/module/given', array('name' => 'ifans', 'openid' => $row['from_user']))?>">下发优惠劵</a>
								</td>
							</tr>
							<?php  } } ?>
							<tr class="search-submit">
								<td colspan="7">
                                    <input type="submit" name="updateselects" value="更新选中" style="color:green;" class="btn pull-right" onclick="{if(confirm('确定更新选中项吗?')){return true;}return false;}"/>&nbsp;&nbsp;
									<input type="submit" name="deleteselects" value="删除选中" style="color:red;" class="btn pull-right" onclick="{if(confirm('确定删除选中项吗?')){return true;}return false;}"/>
									<input type="hidden" name="token" value="<?php  echo $_W['token'];?>" />
								</td>
							</tr>
						</tbody>
					</table>
					<table class="table">
						<tr>
							<td class="row-first"></td>
							<td>
								<input type="hidden" name="token" value="<?php  echo $_W['token'];?>" />
							</td>
						</tr>
					</table>
				</div>
				</form>
				<?php  echo $pager;?>
			</div>
		</div>
	</div>
</div>
<?php  include $this->template('common/footer', TEMPLATE_INCLUDEPATH);?>